package org.spamforces.dao;

import org.spamforces.model.Sms;

import java.util.List;
import java.util.Set;

/**
 * @author Maxim Shipko (sladethe@gmail.com)
 *         Date: 09.12.14
 */
public interface SmsDao {
    Sms find(long id);

    void save(Sms sms);

    void update(Sms sms);

    List<Sms> peek(int maxSize);

    boolean isAnythingInQueue(long broadcastId);

    void insert(List<Sms> smsList);

    Set<String> smsSetDoneOrQueueByTargetBroadcastId(long broadcastId);

    Statistics findStatisticsByBroadcastId(long broadcastId);

    class Statistics {
        private int queueCount;
        private int failedCount;
        private int doneCount;

        public void setQueueCount(int queueCount) {
            this.queueCount = queueCount;
        }

        public void setFailedCount(int failedCount) {
            this.failedCount = failedCount;
        }

        public void setDoneCount(int doneCount) {
            this.doneCount = doneCount;
        }

        public int getQueueCount() {
            return queueCount;
        }

        public int getFailedCount() {
            return failedCount;
        }

        public int getDoneCount() {
            return doneCount;
        }
    }
}
